package com.basic.backend.model.dto.articles;

import com.basic.backend.common.PageRequest;
import com.basic.backend.model.enums.ArticleStatusEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
import java.util.List;

/**
 * 文章分页查询请求
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class ArticleQueryRequest extends PageRequest {

    @ApiModelProperty("文章ID（精确查询）")
    private Long articleId;

    @ApiModelProperty("作者用户ID（精确查询）")
    private Long userId;

    @ApiModelProperty("标题关键词（模糊查询）")
    private String title;

    @ApiModelProperty("内容关键词（模糊查询）")
    private String content;

    @ApiModelProperty("状态列表（多选查询）")
    private List<ArticleStatusEnum > statusList;

    @ApiModelProperty("创建时间范围查询")
    private TimeRange createTimeRange;

    @Data
    public static class TimeRange {
        @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        private Date startTime;
        
        @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        private Date endTime;
    }
}